<!--客户自带材料 -->
<template>
	<div class='b6'>
			<h4 style="padding-left: 36px;">客户自带材料</h4>
			<el-table  :data="useType=='set'||useType=='copy'||useType=='look'?manOur:manOurs" :header-cell-style="{color:'#333',fontSize:'14px',fontWeight:'bold',fontSize:'16px',backgroundColor:'#d7d7d7'}" style="width: 100%">
			  <el-table-column align='center'  prop="goodsName" label="商品名称">
					<template slot-scope="scope">
							<el-input size='mini' v-model="scope.row.goodsName" placeholder='请输入商品名称' :disabled='dis' @change='input'></el-input>
					</template>
				</el-table-column>
			  <el-table-column align='center' prop="brandName" label="品牌">
					<template slot-scope="scope">
							<el-input size='mini' v-model="scope.row.brandName" placeholder='请输入品牌' :disabled='dis' @change='input'></el-input>
					</template>
				</el-table-column>
			  <el-table-column align='center' prop="model" label="规格型号">
					<template slot-scope="scope">
							<el-input size='mini' v-model="scope.row.model" placeholder='请输入规格型号' :disabled='dis' @change='input'></el-input>
					</template>
				</el-table-column>
				<el-table-column align='center' prop="goodsCount" label="商品数量" width="130">
				<template slot-scope="scope">
					<!-- :disabled="scope.row.gift==1" -->
					<el-input-number style="width: 100%;" :min="1" size="mini" v-model="scope.row.goodsCount" @change="changeManOurNum(scope.row.price,scope.row.goodsCount,scope.$index, manOur)"  label="描述文字" :disabled='dis'></el-input-number>
				</template>						
				</el-table-column>
				<el-table-column align='center' prop="remarks" label="备注">
					<template slot-scope="scope">
						<el-input size='mini' v-model="scope.row.remarks" placeholder='请输入备注' :disabled='dis' @change='input'></el-input>
					</template>
				</el-table-column>
				<el-table-column align='center' prop="" label="操作">
					<template slot-scope="scope">
						<div><el-button @click.native.prevent="deleteRow(scope.$index, manOur)" style="color:red" type="text" size='small' :disabled='dis'>删除</el-button></div>
					</template>
				</el-table-column>
			</el-table>
			
			<div v-if="dis!=true" class="add" @click="add">
				<h3>+新增</h3>
			</div>
	</div>
</template>

<script>
	export default {
		components: {
		},
		props:{
			dis:{
			type:Boolean,
			},
			manOur:{
				type:Array
			},
			useType:String
		},
		data () {
			return {
			// 搜索
			manOurSearch:'',
			manOurs:[{goodsName:'',brandName:'',model:'',goodsCount:'1',remarks:''}],
			};
		},
		computed: {

		},
		methods: {
		/**
		 * 客户自带材料
		 */
		// 新增
		add(){
			this.manOurs.push({goodsName:'',brandName:'',model:'',goodsCount:'1',remarks:''})
		},
		
		//提交给父组件的数据
		input(){
			this.$emit('children',this.manOurs)
		},
	
	
		// 删除本行信息
		deleteRow(index, rows) {
			this.manOurs.splice(index,1)
			this.$emit('children',this.manOurs)
		},

		// 服务次数步进器
		changeManOurNum(money,num,index,row){
			this.$emit('children',this.manOurs)
		},
		
		},
mounted() {
},
created() {}, //生命周期 - 创建之后
	}
</script>

<style scoped>
.b6{
	background: #fff;border-radius:15px ;margin-top: 10px;padding-top: 10px;
}
.add{
	display: flex;
	justify-content: center;
	background: #66FFFF;
	margin-left: 10px;
	margin-right: 10px;
	margin-top: 10px;
	color: #0000FF;
}
</style>

